package com.qd.common.panda.domain.entity.commodity;

import com.cdqidi.dict.annotation.FieldBind;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.qd.common.dict.DictConstant;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 商品分类列表
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class CommodityClassificationListDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "商品分类ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "商品分类ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String commodityClassificationId;
    /**
     * 排序
     */
    private Integer idx;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 修改时间
     */
    private LocalDateTime updateTime;
    /**
     * 删除时间
     */
    private LocalDateTime deleteTime;
    /**
     * 是否删除
     */
    @NotNull(message = "是否删除不能为空", groups = DefaultGroup.class)
    private Integer isDeleted;
    /**
     * 商品ID
     */
    @Size(max = 50, message = "商品ID长度不能超过{max}位", groups = DefaultGroup.class)
    @FieldBind(targetField = "commodityIdDisplay", processName = DictConstant.DC_COMMODITY_NAME)
    private String commodityId;
    /**
     * 商品ID显示
     */
    private String commodityIdDisplay;
    /**
     * 分类编码
     */
    @NotBlank(message = "分类编码不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "分类编码长度不能超过{max}位", groups = DefaultGroup.class)
    @FieldBind(targetField = "classificationCodeDisplay", processName = DictConstant.DC_COMMODITY_CLASSIFICATION)
    private String classificationCode;
    /**
     * 分类编码显示
     */
    private String classificationCodeDisplay;
    /**
     * 操作人
     */
    @FieldBind(targetField = "operatorDisplay", processName = DictConstant.SYS_LOGIN_USER)
    @Size(max = 50, message = "操作人长度不能超过{max}位", groups = DefaultGroup.class)
    private String operator;
    /**
     * 操作人显示
     */
    private String operatorDisplay;
    /**
     * 机构ID
     */
    @FieldBind(targetField = "orgIdDisplay", processName = DictConstant.SYS_ORG)
    @Size(max = 50, message = "机构ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String orgId;
    /**
     * 机构ID显示
     */
    private String orgIdDisplay;

    @Override
    public void freeData() {
        this.commodityClassificationId = null;
        this.idx = null;
        this.addTime = null;
        this.updateTime = null;
        this.deleteTime = null;
        this.isDeleted = null;
        this.commodityId = null;
        this.commodityIdDisplay = null;
        this.classificationCode = null;
        this.classificationCodeDisplay = null;
        this.operator = null;
        this.operatorDisplay = null;
        this.orgId = null;
        this.orgIdDisplay = null;
        super.freeData();
    }
}
